import mx.containers.Panel;
import mx.events.MenuEvent;
import mx.rpc.events.FaultEvent;

import pages.common.PaginationHelper;

private function isLoginUser():void{
	loginPage.isLoginUser();
}

private function isLoginUserFault(event:FaultEvent):void {  
	ExternalInterface.call("function(){window.location.href=\'hotline.html'\;}");
}





private function createNewWindow(w:Panel):void {
   //w.x = 100 + this.numChildren * 20;
   //w.y = 50 + this.numChildren * 20;
   this.addChild(w); 
}

private   function   defaultMenu():void     
{ 
       		myViewStack.selectedChild=custTelRecordSearchX9;                   
}

private  function menuHandler(event:MenuEvent):void     
{ 
       if ("U"==event.item.@value)
       {
       		myViewStack.selectedChild=x1;
       		if(x1!=null&&x1.createCompleteInd){
				x1.userStack.selectedIndex=0;
				x1.resetPage();
       		}
       }
       else if ("S"==event.item.@value)
       {
       		myViewStack.selectedChild=x2;
       		if(x2!=null&&x2.createCompleteInd){
				x2.sysStack.selectedIndex=0;
				x2.resetPage();
       		}
       }
       else if ("M"==event.item.@value)
       {
       		myViewStack.selectedChild=x3;
			if(x3!=null&&x3.createCompleteInd){
				x3.moduleStack.selectedIndex=0;
				x3.resetPage();
       		}
       } 
       else if ("E"==event.item.@value)
       {
       		myViewStack.selectedChild=x4;
       		if(x4!=null&&x4.createCompleteInd){
       			x4.resetPage();
				x4.initEmail();
       		}
       } 
       else if ("I"==event.item.@value)
       {
       		myViewStack.selectedChild=x5;
       		if(x5!=null&&x5.createCompleteInd){
				x5.issueStack.selectedIndex=0;
				x5.resetPage();
       		}
       }
       else if ("C"==event.item.@value)
       {
       		myViewStack.selectedChild=x6;
       		if(x6!=null&&x6.createCompleteInd){
				x6.companyStack.selectedIndex=0;
				x6.resetPage();
       		}
       }       
       else if ("P"==event.item.@value)
       {
       		myViewStack.selectedChild=x7;
       		if(x7!=null&&x7.createCompleteInd){
				x7.personStack.selectedIndex=0;
				x7.resetPage();
       		}
       }
	   else if ("R"==event.item.@value)
       {
       		myViewStack.selectedChild=x8;
       		if(x8!=null&&x8.createCompleteInd){
				x8.resetPage();
       		}
       }
	  else if ("H"==event.item.@value)
       {
       		myViewStack.selectedChild=custTelRecordSearchX9;
       		if(custTelRecordSearchX9!=null){
       			custTelRecordSearchX9.isFirstSearch=true;
				custTelRecordSearchX9.initApp();
       		}
       }
       else if ("T"==event.item.@value)
       {
       		myViewStack.selectedChild=x9;
       		if(x9!=null&&x9.createCompleteInd){
				x9.resetPage();
       		}
       }
		else if ("TM"==event.item.@value)
       {
       		myViewStack.selectedChild=x10;
       		if(x10!=null&&x10.createCompleteInd){
				x10.resetPage();
       		}
       }
       else if ("K"==event.item.@value)
       {
       		myViewStack.selectedChild=x11;
       		if(x11!=null&&x11.createCompleteInd){
				x11.resetPage();
       		}
       }  
       else if ("DP"==event.item.@value)
       {
       		myViewStack.selectedChild=x12;
       		if(x12!=null&&x12.createCompleteInd){
				x12.resetPage();
       		}
       }                
       else if ("logout"==event.item.@value)
       {
       		logout();
       }
       else if ("CP"==event.item.@value)
       {
       		myViewStack.selectedChild=x13;
       		if(x13!=null&&x13.createCompleteInd){
				x13.resetPage();
       		}
       } 
               
}

	private function exitSystemResult(event:ResultEvent):void{
		ExternalInterface.call("function(){window.location.href='hotline.html';}");
	}